<form class="form-horizontal" action="{:U('setting/statusflowadd')}" method="post">
	<input type="hidden" name="status_id" value="{$status.status_id}"/>
	<table class="table">
		<tr>
			<th colspan="2">{:L('BASIC_INFO')}</th>
		</tr>
		<tr>
			<td width="20%" class="tdleft">{:L('NAME')}</td>
			<td><input type="text" name="name" class="span3"/></td>
		</tr>
		<tr>
			<td width="20%" class="tdleft">{:L('STATE_FLOW_CONTENT')}</td>
			<td><p id="attachment1">
					<select name="status[]">
						<volist name="statusList" id="vo"><option value="{$vo.name}">{$vo.name}</option></volist>
					</select></p> 
					<a id="add_status" href="javascript:add_status(1);">{:L('ADD_A_STATE')}</a></td>
		</tr>
		<tr>
			<td class="tdleft">{:L('STATE_FLOW_DESCRIPTION')}</td>
			<td><textarea class="span4" rows="4" name="description"></textarea></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td><input class="btn btn-primary" type="submit" value="{:L('SAVE')}"/> &nbsp;
			<input class="btn" type="button" onclick="javascript:$('#dialog-add').dialog('close');" value="{:L('CANCEL')}"/></td>
		</tr>
	</table>
</form>
<script type="text/javascript">
function add_status(id) {
	$("#add_status").before('<p id="attachment' + id + '"><select name="status[]"><volist name="statusList" id="vo"><option value="{$vo.name}">{$vo.name}</option></volist></select> <a href=\'javascript:$("#attachment' + id + '").remove();\'>{:L('DELETE')}</a></p>');
	$("#add_status").attr('href', 'javascript:add_status(' + (id+1) + ');');
}
</script>